package com.newcoder.huawei;

import java.util.Arrays;
import java.util.Scanner;
import java.util.Stack;

public class AB30 {

    private static Stack<Integer> stack = new Stack<>();

    public static void main(String... args) {
        int[] arr = new int[]{5,2,3,1,4};
        int[] result = solution(arr);
        System.out.println(Arrays.toString(result));
    }

    public static int[] solution (int[] arr) {
        for (int i = 0; i < arr.length; i++) {
            for (int j = i+1; j < arr.length; j++) {

                if(arr[j]<arr[i]){
                    int temp = arr[i];
                    arr[i] = arr[j];
                    arr[j] = temp;
                }

            }
        }
        return arr;
    }

} 